public class DT
A collection of Dynamo Tools static methods similar to defined functions. This popular class is included in the Dynamo Tools config.bbx files, so it does not require a 'use' statement.
| Modifier and Type | Method and Description |
|---|---|
static BBjString | addS(BBjString word$, BBjNumber count)Return the plural of a word based on a numeric value.
?DT.addS("order", 10)
?DT.addS("order", 1)
|
static BBjString | addS(BBjNumber count, BBjString word$)Returns a string showing quantity and text as plural when quantity is greater than 1. ?DT.addS(1234, "Order") ?DT.addS(1, "Order") |
static BBjString | appendQueryString(BBjString query$, BBjString key$, BBjString value$)Appends key and value to query string.
?DT.appendQueryString("/dt/payment/charge", "mode", "card-not-present")
?DT.appendQueryString("/dt/payment/charge?mode=card-not-present", "amount", "100.00")
?DT.appendQueryString("/dt/payment/charge?mode=card-not-present&amount=100.00", "status", "4")
/dt/payment/charge?mode=card-not-present
/dt/payment/charge?mode=card-not-present&amount=100.00
/dt/payment/charge?mode=card-not-present&amount=100.00&status=4
|
static BBjString | appendQueryString(BBjString query$, BBjString key$, BBjString value$, Boolean urlEncode!) |
static BBjString | appendQueryString(BBjString query$, Map map!)Append map of keys and values to query string (without url encoding).
map! = new java.util.HashMap()
map!.put("mode", "card-not-present")
map!.put("amount", 100.00)
map!.put("success", Boolean.TRUE)
?DT.appendQueryString("/dt/payment/charge", map!)
/dt/payment/charge?mode=card-not-present&amount=100.00&success=true
|
static BBjString | appendQueryString(BBjString query$, Map map!, Boolean urlEncode!)Append map of keys and values to query string with optional url encoding.
map! = new java.util.HashMap()
map!.put("mode", "card-not-present")
map!.put("amount", 100.00)
map!.put("success", Boolean.TRUE)
?DT.appendQueryString("/dt/payment/charge", map!, Boolean.TRUE)
/dt/payment/charge?mode=card-not-present&amount=100.00&success=true
|
static Object | awsCommand(BBjString command$) |
static BBjString | base64Decode(BBjString text$) |
static BBjInt | base64Decode(BBjString text$, BBjNumber chan)Decode and store large base64 string in file |
static BBjString | base64Encode(BBjString text$) |
static BBjString | bin2Text(BBjString text$)Convert text to readable format. Returns non-printable characters less $20$ and $7f$ in [TXT] format. Returns non-printable characters greater than $7f$ in [$ hex $] format. ?DT.bin2Text($0102030405$ + "12345" + $7f808182$) [SOH][STX][ETX][EOT][ENQ]12345[DEL][$80$][$81$][$82$] |
static BBjString | binaryNibbleToHex(BBjString binStr$) |
static BBjString | binaryStringToString(BBjString string$) |
static BBjVector | buildListVector(BBjString filename$, BBjInt knum%, BBjString keyPre$, BBjString keyfield$, BBjString relatedString$, Boolean includeAll!) |
static BBjString | charToBinaryString(BBjString char$) |
static BBjString | cleanCRLFString(BBjString text!) |
static BBjString | cleanFileName(BBjString filename!) |
static BBjString | cleanString(BBjString text!) |
static BBjString | cleanTabCRLFString(BBjString text!) |
static void | clientLog(BBjString text$)Log text to client side log file. For BBj Desktop App's, the client log file is located at /Users/{USERID}/{APPID}/log/{APPID}_{USERID}.out, i.e., C:\Users\len\Dynamo\log\Dynamo_len.out |
static Object | clientTime(BBjInt jdate%, BBjNumber time) |
static BBjTemplatedString | clone(BBjTemplatedString rec!) |
static BBjColor | COLOR_EXCELLWARE_BACKGROUND()Excellware colors |
static BBjColor | COLOR_EXCELLWARE_BACKGROUND_DARKER() |
static BBjColor | COLOR_EXCELLWARE_PIE_BLUE() |
static BBjColor | COLOR_EXCELLWARE_PIE_BLUE_DARKER() |
static BBjColor | COLOR_EXCELLWARE_PIE_GREEN() |
static BBjColor | COLOR_EXCELLWARE_PIE_ORANGE() |
static BBjColor | COLOR_EXCELLWARE_PIE_RED() |
static BBjColor | COLOR_GRID_HEADER_BACKGROUND() |
static BBjNumber | contrast(BBjString rgb1$, BBjString rgb2$) |
static BBjString | CP()simulate 'cp' on SYSWINDOW with 132 cols |
static BBjString | currencyToString(BBjNumber value)Mask currency amount with commas and cents. ?DT.currencyToString(1234.5) 1, 234.50 |
static void | downloadFile(BBjString serverFile$) |
static BBjString | elapsedTimeString(BBjNumber startTime, BBjNumber stopTime) |
static BBjString | elapsedTimeString(BBjNumber startTime, BBjNumber stopTime, BBjInt count%) |
static BBjString | escapeAllLuceneSearch(BBjString search!) |
static BBjString | escapeLuceneSearch(BBjString search!) |
static BBjVector | execWindowsCommand(BBjString cmd$) |
static BBjString | extraCleanFileName(BBjString filename!) |
static BBjInt | firstOfLastMonth() |
static BBjInt | firstOfNextMonth(BBjInt jdate%) |
static BBjInt | firstOfPriorMonth(BBjInt jdate%) |
static BBjInt | firstOfThisMonth() |
static BBjString | formatJavaDate(Date date!) |
static BBjString | formatJavaDate(Date date!, BBjString mask$) |
static BBjString | formatJson(DTJsonObject jsonObj!) |
static BBjString | formatJson(DTJsonArray jsonArray!) |
static BBjString | formatJson(BBjString jsonIn!) |
static BBjString | formatJson2(String jsonIn!) |
static BBjInt | formDateToJulian(BBjString date$)Convert date in YYYY-MM-DD format to BBj julian date.
?DT.formDateToJulian("2024-03-08")
?date(2460378)
2460378
03/08/24
|
static BBjString | getAccessCode() |
static DTJsonArray | getAllScreensInfo() |
static BBjString | getAlpha(BBjString name$) |
static BBjString | getBBXDIR()Method to get BBj bin directory, typically /u/basis/bbj/bin/. ?DT.getBBXDIR() /u/basis/bbj/bin/ |
static BBjString | getCC()Return Company Code. ?DT.getCC() DS |
static BBjString | getClassName(Object object!)Return Class Name of an Object.
?DT.getClassName(123.45)
?DT.getClassName(5)
?DT.getClassName("abc")
?DT.getClassName(new DTJsonObject())
?DT.getClassName(new BBjVector())
BBjNumber
BBjInt
String
DTJsonObject
BBjVector
|
static BBjString | getClientDownloadsDirectory() |
static BBjString | getClientHomeDirectory() |
static BBjString | getClientHostName() |
static BBjString | getClientId() |
static BBjString | getClientOS() |
static BBjString | getDirectoryJson(BBjString directory$, BBjString filetypes$) |
static BBjVector | getDisplayValues(BBjString rec$, BBjString fieldName$) |
static BBjString | getDynawebHomePage()Get URL for Dynaweb Home Page. URL is based on Company Info Dynaweb Address field or server name if not set. ?DT.getDynawebHomePage() https://dev.excellware.com/CD/gui/?cc=EX |
static BBjString | getDynawebHomePage(BBjString cc$)Get URL for Dynaweb Home Page for specified company. URL is based on Company Info Dynaweb Address field or server name if not set.
?DT.getDynawebHomePage("CC")
https://dev.excellware.com/CD/gui/?cc=CC
|
static BBjVector | getFieldNames(BBjString rec$) |
static HashMap | getFieldsMap(DTJsonObject row!)Return HashMap for a posted grid row. This method is useful when processing a posted Dynamo Tools Entry Grid. It returns a map containing all of the field names and values of the row. Use map!.get("fieldName").toString() for strings. Use cast(Boolean, map!.get("fieldName") for Boolean true/false values including checkboxes. Use num(map!.get("fieldName").toString()) for numbers and integers. ToDo add example |
static BBjString | getFileNameExtension(BBjString filename!)Return the extension of a file name, including period.
?DT.getFileNameExtension("program.bbj")
?DT.getFileNameExtension("spreadsheet.xlsx")
|
static BBjString | getFilePath(BBjString CompCode!, BBjString ddName!) |
static BBjString | getFileType(BBjString filename$) |
static Object | getFirstMapKey(LinkedHashMap map!)Return first key in a LinkedHashMap. |
static BBjTemplatedString | getFormFieldsAsBBjTemplatedString(DTJsonArray fields!) |
static Rectangle | getFullSizeWindow(BBjSysGui gui!) |
static BBjString | getHtmlStack() |
static Dimension | getImageDimension(BBjString path!)Return the Dimension of an image which provides its width and height. You can provide either a URL or local disk path.
?DT.getImageDimension("https://www.excellware.com/files/7713/7303/6543/logo341x120.png")
?DT.getImageDimension("/u/CDI/CD/web/images/BBj.png")
Use the getWidth() and getHeight() methods as needed
?DT.getImageDimension("/u/CDI/CD/web/images/BBj.png").getWidth()
80
dim! = DT.getImageDimension("https://www.excellware.com/files/7713/7303/6543/logo341x120.png")
?dim!.getWidth()
?dim!.getHeight()
341
120
|
static BBjString | getMacSn() |
static BBjVector | getMapKeys(Map map!)Return map keys as vector.
map! = new java.util.HashMap()
map!.put("OH", "Ohio")
map!.put("IA", "Iowa")
map!.put("UT", "Utah")
?DT.getMapKeys(map!)
[IA, OH, UT]
|
static BBjString | getMapString(HashMap map!, BBjString key$)Return string for map value.
map! = new java.util.HashMap()
map!.put("OH", "Ohio")
map!.put("IA", "Iowa")
map!.put("UT", "Utah")
?DT.getMapString(map!, "IA")
?DT.getMapString(map!, "NM")
Iowa
|
static BBjVector | getMapValues(Map map!)Return map values as vector.
map! = new java.util.HashMap()
map!.put("OH", "Ohio")
map!.put("IA", "Iowa")
map!.put("UT", "Utah")
?DT.getMapValues(map!)
[Iowa, Ohio, Utah]
|
static BBjString | getMaterializeSizes(BBjNumber formWidth, BBjNumber maxlength)Return recommended Materialize Size. This routine is used to compute the width of form fields on a Dynamo Tools form. ?DT.getMaterializeSizes(1000, 6) ?DT.getMaterializeSizes(1000, 7) ?DT.getMaterializeSizes(1000, 24) ?DT.getMaterializeSizes(1000, 34) ?DT.getMaterializeSizes(1000, 43) ?DT.getMaterializeSizes(1000, 52) s1 s2 s3 s4 s5 s6 |
static BBjString | getMaxWidth(BBjNumber maxWidth) |
static BBjInt | getMdiClientPid(BBjString progName$)Return Process ID of program running in my mdi group
?DT.getMdiClientPid("DTDebugConfiguration.bbj")
356
|
static BBjString | getMode() |
static BBjString | getMonospacedFont()Returns preferred monospaced font name that is present on client. ?DT.getMonospacedFont() Lucida Console |
static BBjString | getMyProcessIP() |
static BBjString | getPreferredSysWindowFont() |
static BBjString | getPreferredSysWindowFont(BBjString operid$) |
static BBjString | getPublicIpAddress() |
static BBjString | getQueryStringValue(BBjString queryString!, BBjString keyword!)Return Query String Value. Returns value string of key within query string, or an empty string if not found. qs$ = "?itemno=ABC456&custno=567890&amount=12.55" ?DT.getQueryStringValue(qs$, "itemno") ?DT.getQueryStringValue(qs$, "custno") ?DT.getQueryStringValue(qs$, "amount") ?DT.getQueryStringValue(qs$, "amt") ABC456 567890 12.55 |
static BBjString | getQueryStringValue(BBjString queryString!, BBjString keyword!, Boolean decode!) |
static BBjString | getRecordsJson(BBjString filename$, BBjNumber kno, BBjString keypfx$) |
static BBjString | getRecordsJson(BBjString filename$, BBjNumber kno, BBjString keypfx$, BBjString fieldnames!) |
static BBjString | getRecordsJson(BBjString filename$, BBjString where$, BBjString sortby$) |
static BBjString | getRecordsJson(BBjString filename$, BBjString where$, BBjString sortby$, BBjString fieldnames!) |
static Map | getRecordsMap(BBjString filename$, BBjNumber kno, BBjString keypfx$) |
static Map | getRecordsMap(BBjString filename$, BBjNumber kno, BBjString keypfx$, BBjString fieldnames!) |
static Map | getRecordsMap(BBjString filename$, BBjString where$, BBjString sortby$, BBjString fieldnames!) |
static BBjVector | getRecordsVector(BBjString filename$, BBjNumber kno, BBjString keypfx$) |
static BBjVector | getRecordsVector(BBjString filename$, BBjNumber kno, BBjString keypfx$, BBjString fieldnames!) |
static BBjVector | getRecordsVector(BBjString filename$, BBjString where$, BBjString sortby$) |
static BBjVector | getRecordsVector(BBjString filename$, BBjString where$, BBjString sortby$, BBjString fieldnames!) |
static Rectangle | getScreenBounds() |
static BBjString | getServerUrl()Return Jetty Url based on server name and Company Info Parameters. ?DT.getServerUrl() https://dev.excellware.com:8443 |
static BBjVector | getSetKeys(HashSet set!)Return HashSet keys as vector.
set! = new java.util.HashSet()
set!.add("OH")
set!.add("IA")
set!.add("UT")
?DT.getMapKeys(set!)
[IA, OH, UT]
|
static BBjTemplatedString | getSM01()Returns the operator information record for the user logged in. sm01! = DT.getSM01() To obtain as a Templated String sm01$: call "DT.bbj::getTemplatedString", DT.getSM01(), sm01$ |
static BBjTemplatedString | getSM08()Returns the active session record. sm08! = DT.geySM08() To obtain as a Templated String sm08$: call "DT.bbj::getTemplatedString", DT.getSM08(), sm08$ |
static BBjString | getSMSDIR()Returns the Dynamo Tools base directory SMSDIR ?DT.getSMSDIR() /u/CDI/ |
static BBjSysGui | getSysGui()Return sysGui object for thin client user. Throws error 14 if not using a thin client, i.e., terminal emulator such as putty or FacetWin. |
static BBjTemplatedString | getTemplatedString(BBjString filename$)Return a BBjTemplatedString for a data file, program file, or structure defined in the Dynamo Tools Data Dictionary. Returns null() if not found.
s084! = DT.getTemplatedString("CDS084")
To obtain as a templated string s084$
call "DT.bbj::getTemplatedString", DT.getTemplatedString("CDS084"), s084$
|
static BBjString | getTemplatedStringValue(BBjTemplatedString templatedString!, BBjString fieldName!) |
static BBjString | getUniqueID() |
static BBjNumber | getUniqueNumber(BBjString key$) |
static BBjString | getUserName(BBjString operid$) |
static BBjNumber | getVmin() |
static BBjString | getWebAddress()Return server webaddress based on Dynamo Configuration. ?DT.getWebaddress() https://dev.excellware.com |
static BBjTemplatedString | getY()get Session Control Variable Y$ as a BBjTemplatedString y! y! = DT.getY() To obtain as Templated String call "DT.bbj::getTemplatedString", DT.getY(), y$ |
static BBjString | HTML_LINE_FEED() |
static BBjString | htmlToUrl(BBjString html$)Return URL to display html string. Uses httpname from Dynamo Configuration Record in CDSM00 file. Uses current application title Y5$ as base for file name. Creates unique file name in /u/CDI/tmp folder.
?DT.htmlToUrl("<h1>This is a test<h1>")
https://dev.excellware.com/tmp/EX-Console_Mode_Operations-307.html
|
static Boolean | inDynamoMenu() |
static Boolean | isClientWindows() |
static Boolean | isDWC() |
static Boolean | isNumberMask(BBjString mask$) |
static Boolean | isNumeric(BBjString rec$, BBjString fieldName$)Is templated field numeric? dim rec$:"qty:n(6), amt:b, id:C(10)" ?DT.isNumeric(rec$, "qty") ?DT.isNumeric(rec$, "amt") ?DT.isNumeric(rec$, "id") true true false |
static Boolean | isRunning(BBjString progName$)Is program running in this session?
?DT.isRunning("CDS069")
true
|
static Boolean | isRunningAnywhere(BBjString progName$)Is program running anywhere in the jvm?
?DT.isRunningAnywhere("CDS069")
true
|
static Boolean | isSessionRunning(BBjNumber sessionNo) |
static Boolean | isWindows() |
static BBjNumber | javaDateToJulian(Date date!) |
static Date | julianToJavaDate(BBjNumber jdate) |
static void | killSession(BBjSessionInfo info!) |
static BBjInt | lastDateInMonth(BBjInt jdate%) |
static BBjInt | lastDateInMonth(BBjInt month%, BBjInt year%) |
static void | log(BBjString text$)Log text to BBj Debug log file. This method stores text provided in namespace until a writeLog method is executed. The DTServlet class uses this method to record web activity which is presented in the Dynamo Tools API log. It is frequently used to log the value of variables while debugging servlets or other background tasks.
DT.log("SONO$=" + sono$)
|
static BBjNumber | luminance(BBjString c$) |
static BBjNumber | luminanceRGB(BBjString rgb$) |
static BBjColor | makeColor(BBjString color$) |
static Map | Map(BBjString filename$, BBjString where$, BBjString sortby$) |
static BBjString | maskEmail(BBjString email$) |
static void | maximizeSyswindow() |
static BBjString | maxString(BBjString str1$, BBjString str2$) |
static BBjNumber | measureText(BBjString text!, BBjString fontName!, BBjNumber fontSize!, BBjNumber fontStyle!) |
static BBjNumber | measureText(BBjString text!, BBjFont font!) |
static BBjVector | measureText(BBjVector textVec!, BBjString fontName!, BBjNumber fontSize!, BBjNumber fontStyle!) |
static BBjVector | measureText(BBjVector textVec!, BBjFont font!) |
static BBjInt | MYDateToJulian(BBjString date$)Convert date in MMM YYYY format to BBj julian date.
?DT.MYDateToJulian("Feb 2025")
2460708
?date(2460708)
02/01/25
|
static BBjString | nextBatchNo(BBjString batno$) |
static BBjString | nibbleToBinaryString(BBjString nibble$) |
static void | openFullBrowser(BBjString filename$)Display pdf, txt, xml or image file in browser or download other file types. When running Dynamo Tools Graphical Menu, display a file in full browser tab. Uses httpname field from Dynamo Configuration file CDSM00. Prepends /tmp/ when no path is provided to file:
DT.openFullBrower("PO1234.pdf")
is the same as:
DT.openFullBrowser("/tmp/PO1234.pdf")
|
static BBjSysGui | openSysGui()Opens and returns sysGui object for thin client user. Throws error 14 if not using a thin client, i.e., terminal emulator such as putty or FacetWin. |
static BBjString | padIpAddress(BBjString ipadr$) |
static BBjString | parensToGlobal(BBjString pth$)Replace global variables in parentheses with values.
?DT.parensToGlobal("Dynamo Tools Base Directory is (SMSDIR)")
Dynamo Tools Base Directory is /u/CDI/
|
static BBjString | quote(BBjString text$)Add quotes around string. x$ = "example string" print DT.quote(x$) "example string" |
static BBjString | recentDate(BBjNumber jdate)Return a string describing a date relative to today. ?DT.recentDate(jul(0, 0, 0) - 5) ?DT.recentDate(jul(0, 0, 0) - 1) ?DT.recentDate(jul(0, 0, 0)) ?DT.recentDate(jul(0, 0, 0) + 1) ?DT.recentDate(jul(0, 0, 0) + 5) ?DT.recentDate(jul(0, 0, 0) - 365) Last Tuesday Yesterday Today Tomorrow Next Friday Sat 03/04/23 |
static BBjString | removeMnemonics(BBjString str$)Remove mnemonics and cursor positioning expressions from a string x$ = @(8, 23) + "here " + 'bu' + "underlined" + 'eu' + @(70) + 'sb' + " updating" + 'rgb'($0033$) print DT.removeMnemonics(x$) here underlined updating |
static BBjString | replace(BBjString string!, BBjString search$, BBjString replace$) |
static BBjString | replaceHtml(BBjString html!) |
static BBjString | replaceLineDrawCharacters(BBjString str$) |
static BBjString | requiredLuceneQuery(BBjString query!, BBjString fieldName$) |
static BBjString | requiredLuceneQuery(BBjString query!, BBjString fieldName$, Boolean wildcard!) |
static BBjString | rotateChar(BBjString char$) |
static BBjString | rotateString(BBjString string$) |
static BBjInt | roundUp(BBjNumber val) |
static BBjString | SEPARATOR() |
static void | setPrefix()Set PREFIX for current company Sets PREFIX based on Company Information Maintenance settings. |
static void | setPrefix(BBjString cc$)Set PREFIX for company code specified. Sets PREFIX based on Company Information Maintenance settings. |
static void | setPrefix(BBjString cc$, BBjString dd00$)Set PREFIX for Company Code specifed. |
static void | setPrefix(BBjString cc$, BBjTemplatedString dd00!)Set PREFIX for Company Code specifed. |
static void | showJson(DTJsonObject jsonObj!) |
static void | showJson(DTJsonArray jsonArray!) |
static void | showMethods(Object r!) |
static BBjString | showString(BBjString string$)Return displayable version of a string. Presents non-displayable strings as hexadecimal.
?DT.showString("abc")
?DT.showString("abc" + $000102$ + "def")
?DT.showString('sf')
'abc'
$616263000102646566$
$1B5346$
|
static BBjString | showTemplatedString(BBjString rec$)Return field names and values of templated string. call "SW001", "CDDD00", 0, "DD", dd00$ ?DT.showTemplatedString(dd00$) NEXTJOBNO 0 DEPLOYNAME Len Krause DEPLOYEMAIL len@excellware.com EXPORTDD Y LOGOURL https://dev.excellware.com/CD/images/ExcellwareLogo341x120.png LOGOWIDTH 341 LOGOHEIGHT 120 LOGINTEXT Dynamo Tools GOOGLEAPI AIzaSyDMb0E6t9SXruUpEVjj-NDDTm3UDlPuDbY EMAILTESTMODE N MFADATE 2460311 (01/01/24) MFAEMAIL Y MFATEXTMSG Y MFAAUTHAPP Y |
static BBjString | showTemplatedString(BBjTemplatedString rec!)Return field names and values of BBjTemplatedString object. call "SW001", "CDDD00", 0, "DD", dd00$ dd00! = DT.toTemplatedString(dd00$) ?DT.showTemplatedString(dd00!) NEXTJOBNO 0 DEPLOYNAME Len Krause DEPLOYEMAIL len@excellware.com EXPORTDD Y LOGOURL https://dev.excellware.com/CD/images/ExcellwareLogo341x120.png LOGOWIDTH 341 LOGOHEIGHT 120 LOGINTEXT Dynamo Tools GOOGLEAPI AIzaSyDMb0E6t9SXruUpEVjj-NDDTm3UDlPuDbY EMAILTESTMODE N MFADATE 2460311 (01/01/24) MFAEMAIL Y MFATEXTMSG Y MFAAUTHAPP Y |
static BBjString | SP()simulate 'sp' on SYSWINDOW, restoring to saved values |
static BBjVector | split(String string!, String sep!) |
static void | stack(BBjString log$)Display and log program stack. Includes program name and line of code being executed for non-protected programs. Displayed and written to Debug log.
DT.stack("")
1: CDS352 [protected]
2: SO104 1340 CALL "CDS352", Y$, SO41$, "SO114", SO41$[ALL], HIGHSEQ, 6, LMAX, 3+2*(CW00.WORKORDERS$="Y"), SO40$, S352$
3: SW101 [protected]
4: SO100 0400 CALL "SW101", ERR=0410, Y$, Y5$, SO40$, SW101$; GOTO 0420
5: CDS037 [protected]
6: SO130 2520 CALL "CDS037", "XXSO40", KN, KP$, DISP$, WINX, WINY, WINROWS, 80, WT$, COLORS$, SELRTN$, WHERE$, SORTBY$, MODE$, LIMITVAL, SO40$
7: SO100 1210 CALL "SO130", Y$, "Y"+STR(S550A.COLENT:"00")+"02", SO40$; REM "Select Order
|
static Boolean | startsWith(BBjString find$, BBjString inThis!)Does a string start with these characters.
?DT.startsWith("abc", "abcdef")
?DT.startsWith("ABC", "abcdef")
if DT.startsWith("abc", "abcdef") then ...
true
false
|
static BBjString | startsWithLuceneSearch(BBjString search$) |
static void | storeFieldsArrayValue(DTJsonArray fields!, BBjString fieldName$, Object value!) |
static BBjString | stringToBinaryString(BBjString string$) |
static HashMap | stringToHashMap(BBjString mapString$) |
static BBjInt | timestampToJulian(BBjString timestamp$)Return julian date from timestamp.
?DT.timestampToJulian("2024-03-08T12:50:00")
?date()
2460378
03/08/24
|
static BBjNumber | timestampToTime(BBjString timestamp$)Return time from timestamp.
precision 7
?DT.timestampToTime("2024-03-08T12:50:00")
?date(0, 12.8333333:"%Hz:%mz:%sz")
12.8333333
12:50:00
|
static BBjNumber | timeStringToNumber(BBjString time$)Return time from time string.
precision 7
?DT.timeStringToNumber("12:50:00")
12.8333333
|
static boolean | toBoolean(BBjNumber value) |
static BBjString | toDateTimeString(BBjNumber millis)Convert time in milliseconds to timestamp display format. ?DT.toDateTimeString(System.currentTimeMillis()) 2024-03-08 13:11:27.717 |
static BBjString | toDateTimeString(Date date!) |
static HashMap | toHashMap(BBjString json!) |
static BBjString | toHtml(BBjString txt$)Convert non-displayable string to html. Non-displayable characters will be presented with a pink backfground inside "$" characters.
?DT.toHtml("abc" + $000102$ + "def")
abc$000102$def
|
static Date | toJavaDate(BBjInt jdate%, BBjNumber time) |
static BBjString | toJson(BBjTemplatedString rec!) |
static BBjString | toJson(BBjTemplatedString rec!, BBjInt trim!) |
static BBjString | toJson(BBjTemplatedString rec!, BBjInt trim!, Boolean format!) |
static BBjString | toJson(HashMap map!) |
static BBjString | toProperCase(BBjString text!)Convert string to Proper case.
?DT.toProperCase("this is a test")
?DT.toProperCase("THIS IS A TEST")
?DT.toProperCase("It's a wonderful day in the neighborhood")
This is a Test
This is a Test
It's a Wonderful Day in the Neighborhood
|
static BBjNumber | toPt(BBjNumber px!) |
static BBjNumber | toPx(BBjNumber pt!) |
static BBjString | toString(Object object!)Returns a string even for null objects. The DT.toString method eliminates the need to test for null() as null objects and objects without a toString() method are returned as an empty string. declare BBjString xyz! xyz! = null() ?len(DT.toString(xyz!)) 0 v! = new BBjVector() ?DT.toString(v!) []
v!.add("abc")
v!.add("def")
v!.add("xyz")
?DT.toString(v!)
[abc, def, xyz]
Can be used to determine if an object is null or has non-blank value if object is null or empty: if DT.toString(xyz!).isEmpty() then ... if object is not null and not empty: if ! DT.toString(xyz!).isEmpty() then ... Can also be used to test for any non-blank characters in a string if ! DT.toString(xyz!).trim().isEmpty() then print "Not null" else print "Null" fi |
static BBjString | toString(BBjNumber value)Convert number to masked string with commas and decimal. print DT.toString(1234567) 1, 234, 567 print DT.toString(1234.5678) 1, 234.5678 print DT.toString(0) |
static BBjString | toString(BBjNumber value, boolean showZero!)Convert number to masked string with commas and decimal and option to show 0. print DT.toString(0, Boolean.TRUE) 0 print DT.toString(0, Boolean.FALSE) |
static BBjTemplatedString | toTemplatedString(Object string!, Object template!)Return BBjTemplatedString given string and template. call "CDS041", "CDS084", s084$, "YP" s084! = DT.toTemplatedString(s084$, fattr(s084$)) |
static BBjTemplatedString | toTemplatedString(BBjString rec$)Return BBjTemplatedString from Templated String variable. cm01! = DT.toTemplatedString(cm01$) |
static BBjTemplatedString | toTemplatedString(DTJsonObject json!, BBjString tplkey$, BBjString reckey$)Return BBjTemplatedString from json containing template and hta(data) as strings.
j! = new DTJsonObject()
j!.put("tpl", "id:n(4), name:c(30*=)")
j!.put("data", hta("1234United States"))
rec! = DT.toTemplatedString(j!, "tpl", "data")
?rec!.fattr()
?rec!.getFieldAsNumber("id")
?rec!.getFieldAsString("name")
|
static BBjNumber | toTimestamp(BBjNumber julDate, BBjNumber time)Convert julian date and time to linux timestamp in milliseconds. ?DT.toTimestamp(jul(0, 0, 0), tim) ?DT.toDateTimeString(1709877714222) 1709877714222 2024-03-08 01:01:54.222 |
static void | traceOff()Stops a trace started with DT.traceOn. |
static void | traceOff(BBjInt action%)Stops a trace and displays. Must be run from Dynamo Tools Menu or BBj thinclient (not a terminal emulator). |
static BBjInt | traceOn()Start untimed trace. Traced BBj code will be saved in /u/CDI/tmp/DTTrace-NNN.txt. |
static BBjInt | traceOn(BBjInt timed%)Start a timed or untimed trace. Traced BBj code will be saved in /u/CDI/tmp/DTTrace-NNN.txt. Timed trace files are used with the BBj Performance Analyzer tool to identify time-consuming code. |
static BBjString | unpadIpAddress(BBjString ipadr$) |
static BBjString | urlDecode(BBjString text$) |
static BBjString | urlEncode(BBjString text$) |
static BBjString | validateAddress(BBjTemplatedString rec!, BBjString pre$) |
static void | writeLog()Write log records stored using DT.log(BBjString). Physically writes log entries created by DT.log(BBjString) to BBj Debug file. |
static void | writeLog(BBjString text$)Log text and write log records stored using DT.log(BBjString). Physically writes log entries created by DT.log(BBjString) to BBj Debug file. This method is called by DTServlet.bbj when responding to a servlet call. Can also be used to log text from a non-servlet application. |
static Map | xmlToTreeMap(BBjString xml$)Convert XML string to TreeMap. |
public static BBjString addS(BBjString word$, BBjNumber count)
Return the plural of a word based on a numeric value.
?DT.addS("order", 10)
?DT.addS("order", 1)
Orders
Order
public static BBjString addS(BBjNumber count, BBjString word$)
Returns a string showing quantity and text as plural when quantity is greater than 1.
?DT.addS(1234, "Order") ?DT.addS(1, "Order")
1, 234 Orders 1 Order
public static BBjString appendQueryString(BBjString query$, BBjString key$, BBjString value$)
Appends key and value to query string.
?DT.appendQueryString("/dt/payment/charge", "mode", "card-not-present")
?DT.appendQueryString("/dt/payment/charge?mode=card-not-present", "amount", "100.00")
?DT.appendQueryString("/dt/payment/charge?mode=card-not-present&amount=100.00", "status", "4")
/dt/payment/charge?mode=card-not-present
/dt/payment/charge?mode=card-not-present&amount=100.00
/dt/payment/charge?mode=card-not-present&amount=100.00&status=4
query$ - base query string.key$ - key to append.value$ - value to append. appendQueryString(BBjString, Map)public static BBjString appendQueryString(BBjString query$, BBjString key$, BBjString value$, Boolean urlEncode!)
public static BBjString appendQueryString(BBjString query$, Map map!)
Append map of keys and values to query string (without url encoding).
map! = new java.util.HashMap()
map!.put("mode", "card-not-present")
map!.put("amount", 100.00)
map!.put("success", Boolean.TRUE)
?DT.appendQueryString("/dt/payment/charge", map!)
/dt/payment/charge?mode=card-not-present&amount=100.00&success=true
query$ - base query string.map! - map containing key value pairs. appendQueryString(BBjString, BBjString, BBjString)public static BBjString appendQueryString(BBjString query$, Map map!, Boolean urlEncode!)
Append map of keys and values to query string with optional url encoding.
map! = new java.util.HashMap()
map!.put("mode", "card-not-present")
map!.put("amount", 100.00)
map!.put("success", Boolean.TRUE)
?DT.appendQueryString("/dt/payment/charge", map!, Boolean.TRUE)
/dt/payment/charge?mode=card-not-present&amount=100.00&success=true
query$ - base query string.map! - map containing key value pairs. appendQueryString(BBjString, BBjString, BBjString)public static BBjInt base64Decode(BBjString text$, BBjNumber chan)Decode and store large base64 string in file
text$ - base64 encoded string.chan - channel of file where decoded string is stored.public static BBjString bin2Text(BBjString text$)
Convert text to readable format.
Returns non-printable characters less $20$ and $7f$ in [TXT] format. Returns non-printable characters greater than $7f$ in [$ hex $] format.
?DT.bin2Text($0102030405$ + "12345" + $7f808182$) [SOH][STX][ETX][EOT][ENQ]12345[DEL][$80$][$81$][$82$]
text$ - non-readable text to be converted.public static BBjVector buildListVector(BBjString filename$, BBjInt knum%, BBjString keyPre$, BBjString keyfield$, BBjString relatedString$, Boolean includeAll!)
public static void clientLog(BBjString text$)Log text to client side log file.
For BBj Desktop App's, the client log file is located at /Users/{USERID}/{APPID}/log/{APPID}_{USERID}.out, i.e., C:\Users\len\Dynamo\log\Dynamo_len.out
text$ - text to be logged on client. log(BBjString) writeLog(BBjString)public static Object clientTime(BBjInt jdate%, BBjNumber time)public static BBjTemplatedString clone(BBjTemplatedString rec!)
public static BBjColor COLOR_EXCELLWARE_BACKGROUND()Excellware colors
public static BBjColor COLOR_EXCELLWARE_BACKGROUND_DARKER()public static BBjColor COLOR_EXCELLWARE_PIE_BLUE()public static BBjColor COLOR_EXCELLWARE_PIE_BLUE_DARKER()public static BBjColor COLOR_EXCELLWARE_PIE_GREEN()public static BBjColor COLOR_EXCELLWARE_PIE_ORANGE()public static BBjColor COLOR_EXCELLWARE_PIE_RED()public static BBjColor COLOR_GRID_HEADER_BACKGROUND()public static BBjString CP()simulate 'cp' on SYSWINDOW with 132 cols
public static BBjString currencyToString(BBjNumber value)Mask currency amount with commas and cents.
?DT.currencyToString(1234.5) 1, 234.50
public static void downloadFile(BBjString serverFile$)public static BBjString elapsedTimeString(BBjNumber startTime, BBjNumber stopTime)public static BBjString elapsedTimeString(BBjNumber startTime, BBjNumber stopTime, BBjInt count%)public static BBjInt firstOfLastMonth()
public static BBjInt firstOfNextMonth(BBjInt jdate%)
public static BBjInt firstOfPriorMonth(BBjInt jdate%)
public static BBjInt firstOfThisMonth()
public static BBjString formatJson(DTJsonObject jsonObj!)
public static BBjString formatJson(DTJsonArray jsonArray!)
public static BBjString formatJson2(String jsonIn!)public static BBjInt formDateToJulian(BBjString date$)Convert date in YYYY-MM-DD format to BBj julian date.
?DT.formDateToJulian("2024-03-08")
?date(2460378)
2460378
03/08/24
date$ - date in YYYY-MM-DD format typically used on web forms.public static BBjString getAccessCode()public static DTJsonArray getAllScreensInfo()public static BBjString getBBXDIR()Method to get BBj bin directory, typically /u/basis/bbj/bin/.
?DT.getBBXDIR() /u/basis/bbj/bin/
public static BBjString getCC()Return Company Code.
?DT.getCC() DS
getY() to return the entire session control variablepublic static BBjString getClassName(Object object!)
Return Class Name of an Object.
?DT.getClassName(123.45)
?DT.getClassName(5)
?DT.getClassName("abc")
?DT.getClassName(new DTJsonObject())
?DT.getClassName(new BBjVector())
BBjNumber
BBjInt
String
DTJsonObject
BBjVector
public static BBjString getClientDownloadsDirectory()public static BBjString getClientHomeDirectory()public static BBjString getClientHostName()public static BBjString getClientId()public static BBjString getClientOS()public static BBjString getDirectoryJson(BBjString directory$, BBjString filetypes$)
public static BBjString getDynawebHomePage()Get URL for Dynaweb Home Page.
URL is based on Company Info Dynaweb Address field or server name if not set.
?DT.getDynawebHomePage() https://dev.excellware.com/CD/gui/?cc=EX
public static BBjString getDynawebHomePage(BBjString cc$)
Get URL for Dynaweb Home Page for specified company.
URL is based on Company Info Dynaweb Address field or server name if not set.
?DT.getDynawebHomePage("CC")
https://dev.excellware.com/CD/gui/?cc=CC
cc$ - 2 character company code.public static HashMap getFieldsMap(DTJsonObject row!)
Return HashMap for a posted grid row.
This method is useful when processing a posted Dynamo Tools Entry Grid. It returns a map containing all of the field names and values of the row. Use map!.get("fieldName").toString() for strings. Use cast(Boolean, map!.get("fieldName") for Boolean true/false values including checkboxes. Use num(map!.get("fieldName").toString()) for numbers and integers.
ToDo add example
row! - the DTJsonObject derived by processing the json array rows!public static BBjString getFileNameExtension(BBjString filename!)
Return the extension of a file name, including period.
?DT.getFileNameExtension("program.bbj")
?DT.getFileNameExtension("spreadsheet.xlsx")
.bbj
.xlsx
public static Object getFirstMapKey(LinkedHashMap map!)
Return first key in a LinkedHashMap.
map! - LinkedHashMap.public static BBjTemplatedString getFormFieldsAsBBjTemplatedString(DTJsonArray fields!)
public static BBjString getHtmlStack()public static Dimension getImageDimension(BBjString path!)
Return the Dimension of an image which provides its width and height.
You can provide either a URL or local disk path.
?DT.getImageDimension("https://www.excellware.com/files/7713/7303/6543/logo341x120.png")
?DT.getImageDimension("/u/CDI/CD/web/images/BBj.png")
java.awt.Dimension[width=341, height=120]
java.awt.Dimension[width=80, height=80]
Use the getWidth() and getHeight() methods as needed
?DT.getImageDimension("/u/CDI/CD/web/images/BBj.png").getWidth()
80
dim! = DT.getImageDimension("https://www.excellware.com/files/7713/7303/6543/logo341x120.png")
?dim!.getWidth()
?dim!.getHeight()
341
120
public static BBjString getMacSn()public static BBjVector getMapKeys(Map map!)
Return map keys as vector.
map! = new java.util.HashMap()
map!.put("OH", "Ohio")
map!.put("IA", "Iowa")
map!.put("UT", "Utah")
?DT.getMapKeys(map!)
[IA, OH, UT]
map! HashMap, LinkedHashMap, TreeMap, etc.public static BBjString getMapString(HashMap map!, BBjString key$)
Return string for map value.
map! = new java.util.HashMap()
map!.put("OH", "Ohio")
map!.put("IA", "Iowa")
map!.put("UT", "Utah")
?DT.getMapString(map!, "IA")
?DT.getMapString(map!, "NM")
Iowa
map! - HashMap, LinkedHashMap, TreeMap, etc.key$ - map key as BBjString.public static BBjVector getMapValues(Map map!)
Return map values as vector.
map! = new java.util.HashMap()
map!.put("OH", "Ohio")
map!.put("IA", "Iowa")
map!.put("UT", "Utah")
?DT.getMapValues(map!)
[Iowa, Ohio, Utah]
map! HashMap, LinkedHashMap, TreeMap, etc.public static BBjString getMaterializeSizes(BBjNumber formWidth, BBjNumber maxlength)Return recommended Materialize Size.
This routine is used to compute the width of form fields on a Dynamo Tools form.
?DT.getMaterializeSizes(1000, 6) ?DT.getMaterializeSizes(1000, 7) ?DT.getMaterializeSizes(1000, 24) ?DT.getMaterializeSizes(1000, 34) ?DT.getMaterializeSizes(1000, 43) ?DT.getMaterializeSizes(1000, 52) s1 s2 s3 s4 s5 s6
formWidth - width of form in pixels. If passed as zero, use SMS_formWidth global. If that is also zero, then use SMS_displayWidth global. If that is also zero use default value of 1000.maxlength - maximum number of characters in field. Materialize Grid and Columns Designpublic static BBjString getMaxWidth(BBjNumber maxWidth)public static BBjInt getMdiClientPid(BBjString progName$)Return Process ID of program running in my mdi group
?DT.getMdiClientPid("DTDebugConfiguration.bbj")
356
progName$ - program name or part of namepublic static BBjString getMode()public static BBjString getMonospacedFont()Returns preferred monospaced font name that is present on client.
?DT.getMonospacedFont() Lucida Console
public static BBjString getMyProcessIP()public static BBjString getPreferredSysWindowFont()public static BBjString getPublicIpAddress()public static BBjString getQueryStringValue(BBjString queryString!, BBjString keyword!)
Return Query String Value.
Returns value string of key within query string, or an empty string if not found.
qs$ = "?itemno=ABC456&custno=567890&amount=12.55" ?DT.getQueryStringValue(qs$, "itemno") ?DT.getQueryStringValue(qs$, "custno") ?DT.getQueryStringValue(qs$, "amount") ?DT.getQueryStringValue(qs$, "amt") ABC456 567890 12.55
queryString! = query string in ?key1=value1&key2=value2&key3=value3 format.keyword! - key to search for. DTServlet::getParameter(BBjString). DTServlet::getParameterAsBoolean(BBjString). DTServlet::getParameterAsInt(BBjString). DTServlet::getParameterAsNumber(BBjString).public static BBjString getQueryStringValue(BBjString queryString!, BBjString keyword!, Boolean decode!)
public static BBjString getRecordsJson(BBjString filename$, BBjNumber kno, BBjString keypfx$)
public static BBjString getRecordsJson(BBjString filename$, BBjNumber kno, BBjString keypfx$, BBjString fieldnames!)
public static BBjString getRecordsJson(BBjString filename$, BBjString where$, BBjString sortby$)
public static BBjString getRecordsJson(BBjString filename$, BBjString where$, BBjString sortby$, BBjString fieldnames!)
public static Map getRecordsMap(BBjString filename$, BBjNumber kno, BBjString keypfx$)
public static Map getRecordsMap(BBjString filename$, BBjNumber kno, BBjString keypfx$, BBjString fieldnames!)
public static Map getRecordsMap(BBjString filename$, BBjString where$, BBjString sortby$, BBjString fieldnames!)
public static BBjVector getRecordsVector(BBjString filename$, BBjNumber kno, BBjString keypfx$)
public static BBjVector getRecordsVector(BBjString filename$, BBjNumber kno, BBjString keypfx$, BBjString fieldnames!)
public static BBjVector getRecordsVector(BBjString filename$, BBjString where$, BBjString sortby$)
public static BBjVector getRecordsVector(BBjString filename$, BBjString where$, BBjString sortby$, BBjString fieldnames!)
public static Rectangle getScreenBounds()public static BBjString getServerUrl()Return Jetty Url based on server name and Company Info Parameters.
?DT.getServerUrl() https://dev.excellware.com:8443
public static BBjVector getSetKeys(HashSet set!)
Return HashSet keys as vector.
set! = new java.util.HashSet()
set!.add("OH")
set!.add("IA")
set!.add("UT")
?DT.getMapKeys(set!)
[IA, OH, UT]
set! HashSet.public static BBjTemplatedString getSM01()Returns the operator information record for the user logged in.
sm01! = DT.getSM01()
To obtain as a Templated String sm01$:
call "DT.bbj::getTemplatedString", DT.getSM01(), sm01$
error 99 when the globals where this information is stored are not set.public static BBjTemplatedString getSM08()Returns the active session record.
sm08! = DT.geySM08()
To obtain as a Templated String sm08$:
call "DT.bbj::getTemplatedString", DT.getSM08(), sm08$
public static BBjString getSMSDIR()Returns the Dynamo Tools base directory SMSDIR
?DT.getSMSDIR() /u/CDI/
public static BBjSysGui getSysGui()Return sysGui object for thin client user. Throws error 14 if not using a thin client, i.e., terminal emulator such as putty or FacetWin.
public static BBjTemplatedString getTemplatedString(BBjString filename$)
Return a BBjTemplatedString for a data file, program file, or structure defined in the Dynamo Tools Data Dictionary.
Returns null() if not found.
s084! = DT.getTemplatedString("CDS084")
To obtain as a templated string s084$
call "DT.bbj::getTemplatedString", DT.getTemplatedString("CDS084"), s084$
public static BBjString getTemplatedStringValue(BBjTemplatedString templatedString!, BBjString fieldName!)
public static BBjString getUniqueID()public static BBjNumber getVmin()public static BBjString getWebAddress()Return server webaddress based on Dynamo Configuration.
?DT.getWebaddress() https://dev.excellware.com
getServerUrl() to obtain URL of BBj web server.public static BBjTemplatedString getY()get Session Control Variable Y$ as a BBjTemplatedString y!
y! = DT.getY()
To obtain as Templated String
call "DT.bbj::getTemplatedString", DT.getY(), y$
getCC() if you only need the Company Code.public static BBjString HTML_LINE_FEED()public static BBjString htmlToUrl(BBjString html$)
Return URL to display html string.
Uses httpname from Dynamo Configuration Record in CDSM00 file. Uses current application title Y5$ as base for file name. Creates unique file name in /u/CDI/tmp folder.
?DT.htmlToUrl("<h1>This is a test<h1>")
https://dev.excellware.com/tmp/EX-Console_Mode_Operations-307.html
html$ - contents of web page.public static Boolean inDynamoMenu()
public static Boolean isClientWindows()
public static Boolean isDWC()
public static Boolean isNumberMask(BBjString mask$)public static Boolean isNumeric(BBjString rec$, BBjString fieldName$)
Is templated field numeric?
dim rec$:"qty:n(6), amt:b, id:C(10)" ?DT.isNumeric(rec$, "qty") ?DT.isNumeric(rec$, "amt") ?DT.isNumeric(rec$, "id") true true false
rec$ - templated string variable.fieldName$ - field name found in rec$.public static Boolean isRunning(BBjString progName$)Is program running in this session?
?DT.isRunning("CDS069")
true
progName$ - program name or part of name stack(BBjInt)public static Boolean isRunningAnywhere(BBjString progName$)Is program running anywhere in the jvm?
?DT.isRunningAnywhere("CDS069")
true
progName$ - program name or part of namepublic static Boolean isSessionRunning(BBjNumber sessionNo)
public static Boolean isWindows()
public static Date julianToJavaDate(BBjNumber jdate)public static void killSession(BBjSessionInfo info!)
public static BBjInt lastDateInMonth(BBjInt jdate%)
public static BBjInt lastDateInMonth(BBjInt month%, BBjInt year%)
public static void log(BBjString text$)Log text to BBj Debug log file.
This method stores text provided in namespace until a writeLog method is executed. The DTServlet class uses this method to record web activity which is presented in the Dynamo Tools API log. It is frequently used to log the value of variables while debugging servlets or other background tasks.
DT.log("SONO$=" + sono$)
text$ - text to be logged. clientLog(BBjString) writeLog(BBjString)public static void maximizeSyswindow()
public static BBjNumber measureText(BBjString text!, BBjString fontName!, BBjNumber fontSize!, BBjNumber fontStyle!)
public static BBjVector measureText(BBjVector textVec!, BBjString fontName!, BBjNumber fontSize!, BBjNumber fontStyle!)
public static BBjVector measureText(BBjVector textVec!, BBjFont font!)public static BBjInt MYDateToJulian(BBjString date$)Convert date in MMM YYYY format to BBj julian date.
?DT.MYDateToJulian("Feb 2025")
2460708
?date(2460708)
02/01/25
date$ - date in %Ms %Yl format typically used on month/year date spinner.public static void openFullBrowser(BBjString filename$)Display pdf, txt, xml or image file in browser or download other file types.
When running Dynamo Tools Graphical Menu, display a file in full browser tab. Uses httpname field from Dynamo Configuration file CDSM00.
Prepends /tmp/ when no path is provided to file:
DT.openFullBrower("PO1234.pdf")
is the same as:
DT.openFullBrowser("/tmp/PO1234.pdf")
filename$ - filename on local server to be displayed or downloaded.public static BBjSysGui openSysGui()Opens and returns sysGui object for thin client user. Throws error 14 if not using a thin client, i.e., terminal emulator such as putty or FacetWin.
public static BBjString parensToGlobal(BBjString pth$)
Replace global variables in parentheses with values.
?DT.parensToGlobal("Dynamo Tools Base Directory is (SMSDIR)")
Dynamo Tools Base Directory is /u/CDI/
public static BBjString quote(BBjString text$)
Add quotes around string.
x$ = "example string" print DT.quote(x$) "example string"
public static BBjString recentDate(BBjNumber jdate)Return a string describing a date relative to today.
?DT.recentDate(jul(0, 0, 0) - 5) ?DT.recentDate(jul(0, 0, 0) - 1) ?DT.recentDate(jul(0, 0, 0)) ?DT.recentDate(jul(0, 0, 0) + 1) ?DT.recentDate(jul(0, 0, 0) + 5) ?DT.recentDate(jul(0, 0, 0) - 365) Last Tuesday Yesterday Today Tomorrow Next Friday Sat 03/04/23
public static BBjString removeMnemonics(BBjString str$)
Remove mnemonics and cursor positioning expressions from a string
x$ = @(8, 23) + "here " + 'bu' + "underlined" + 'eu' + @(70) + 'sb' + " updating" + 'rgb'($0033$) print DT.removeMnemonics(x$) here underlined updating
public static BBjString replace(BBjString string!, BBjString search$, BBjString replace$)
public static BBjString requiredLuceneQuery(BBjString query!, BBjString fieldName$)
public static BBjString requiredLuceneQuery(BBjString query!, BBjString fieldName$, Boolean wildcard!)
public static BBjInt roundUp(BBjNumber val)
public static BBjString SEPARATOR()public static void setPrefix()
Set PREFIX for current company
Sets PREFIX based on Company Information Maintenance settings.
public static void setPrefix(BBjString cc$)Set PREFIX for company code specified.
Sets PREFIX based on Company Information Maintenance settings.
public static void setPrefix(BBjString cc$, BBjString dd00$)
Set PREFIX for Company Code specifed.
cc$ - Company Codedd00$ - Company Information Record from data file XXDD00. setPrefix() setPrefix(BBjString) setPrefix(BBjString, BBjTemplatedString)public static void setPrefix(BBjString cc$, BBjTemplatedString dd00!)
Set PREFIX for Company Code specifed.
cc$ - Company Codedd00! - Company Information Record from data file XXDD00. setPrefix() setPrefix(BBjString) setPrefix(BBjString, BBjString)public static void showJson(DTJsonObject jsonObj!)public static void showJson(DTJsonArray jsonArray!)public static void showMethods(Object r!)public static BBjString showString(BBjString string$)
Return displayable version of a string.
Presents non-displayable strings as hexadecimal.
?DT.showString("abc")
?DT.showString("abc" + $000102$ + "def")
?DT.showString('sf')
'abc'
$616263000102646566$
$1B5346$
string$ - any string to be processed.public static BBjString showTemplatedString(BBjString rec$)
Return field names and values of templated string.
call "SW001", "CDDD00", 0, "DD", dd00$ ?DT.showTemplatedString(dd00$) NEXTJOBNO 0 DEPLOYNAME Len Krause DEPLOYEMAIL len@excellware.com EXPORTDD Y LOGOURL https://dev.excellware.com/CD/images/ExcellwareLogo341x120.png LOGOWIDTH 341 LOGOHEIGHT 120 LOGINTEXT Dynamo Tools GOOGLEAPI AIzaSyDMb0E6t9SXruUpEVjj-NDDTm3UDlPuDbY EMAILTESTMODE N MFADATE 2460311 (01/01/24) MFAEMAIL Y MFATEXTMSG Y MFAAUTHAPP Y
Templated String Variable rec$ showTemplatedString(BBjTemplatedString)public static BBjString showTemplatedString(BBjTemplatedString rec!)
Return field names and values of BBjTemplatedString object.
call "SW001", "CDDD00", 0, "DD", dd00$ dd00! = DT.toTemplatedString(dd00$) ?DT.showTemplatedString(dd00!) NEXTJOBNO 0 DEPLOYNAME Len Krause DEPLOYEMAIL len@excellware.com EXPORTDD Y LOGOURL https://dev.excellware.com/CD/images/ExcellwareLogo341x120.png LOGOWIDTH 341 LOGOHEIGHT 120 LOGINTEXT Dynamo Tools GOOGLEAPI AIzaSyDMb0E6t9SXruUpEVjj-NDDTm3UDlPuDbY EMAILTESTMODE N MFADATE 2460311 (01/01/24) MFAEMAIL Y MFATEXTMSG Y MFAAUTHAPP Y
rec! - BBjTemplatedString object. showTemplatedString(BBjString)public static BBjString SP()simulate 'sp' on SYSWINDOW, restoring to saved values
public static BBjVector split(String string!, String sep!)public static void stack(BBjString log$)Display and log program stack.
Includes program name and line of code being executed for non-protected programs. Displayed and written to Debug log.
DT.stack("")
1: CDS352 [protected]
2: SO104 1340 CALL "CDS352", Y$, SO41$, "SO114", SO41$[ALL], HIGHSEQ, 6, LMAX, 3+2*(CW00.WORKORDERS$="Y"), SO40$, S352$
3: SW101 [protected]
4: SO100 0400 CALL "SW101", ERR=0410, Y$, Y5$, SO40$, SW101$; GOTO 0420
5: CDS037 [protected]
6: SO130 2520 CALL "CDS037", "XXSO40", KN, KP$, DISP$, WINX, WINY, WINROWS, 80, WT$, COLORS$, SELRTN$, WHERE$, SORTBY$, MODE$, LIMITVAL, SO40$
7: SO100 1210 CALL "SO130", Y$, "Y"+STR(S550A.COLENT:"00")+"02", SO40$; REM "Select Order
log$ - optional text to append to output.public static Boolean startsWith(BBjString find$, BBjString inThis!)
Does a string start with these characters.
?DT.startsWith("abc", "abcdef")
?DT.startsWith("ABC", "abcdef")
if DT.startsWith("abc", "abcdef") then ...
true
false
find$ - BBjString to test for.inThis! - BBjString to be looked in.public static void storeFieldsArrayValue(DTJsonArray fields!, BBjString fieldName$, Object value!)
public static BBjInt timestampToJulian(BBjString timestamp$)Return julian date from timestamp.
?DT.timestampToJulian("2024-03-08T12:50:00")
?date()
2460378
03/08/24
timestamp$ - timestamp that starts with date in YYYY-MM-DD format.public static BBjNumber timestampToTime(BBjString timestamp$)
Return time from timestamp.
precision 7
?DT.timestampToTime("2024-03-08T12:50:00")
?date(0, 12.8333333:"%Hz:%mz:%sz")
12.8333333
12:50:00
timestamp$ - timestamp that has time in HH:MM:SS format.public static BBjNumber timeStringToNumber(BBjString time$)
Return time from time string.
precision 7
?DT.timeStringToNumber("12:50:00")
12.8333333
time$ - time in HH:MM:SS format. #return BBjNumber which will be from 0 to less than 24 as hours and fractional hours.public static boolean toBoolean(BBjNumber value)
public static BBjString toDateTimeString(BBjNumber millis)Convert time in milliseconds to timestamp display format.
?DT.toDateTimeString(System.currentTimeMillis()) 2024-03-08 13:11:27.717
millis - time in milliseconds.public static BBjString toHtml(BBjString txt$)
Convert non-displayable string to html.
Non-displayable characters will be presented with a pink backfground inside "$" characters.
?DT.toHtml("abc" + $000102$ + "def")
abc$000102$def
public static Date toJavaDate(BBjInt jdate%, BBjNumber time)public static BBjString toJson(BBjTemplatedString rec!)
public static BBjString toJson(BBjTemplatedString rec!, BBjInt trim!)
public static BBjString toJson(BBjTemplatedString rec!, BBjInt trim!, Boolean format!)
public static BBjString toProperCase(BBjString text!)
Convert string to Proper case.
?DT.toProperCase("this is a test")
?DT.toProperCase("THIS IS A TEST")
?DT.toProperCase("It's a wonderful day in the neighborhood")
This is a Test
This is a Test
It's a Wonderful Day in the Neighborhood
public static BBjNumber toPt(BBjNumber px!)public static BBjNumber toPx(BBjNumber pt!)public static BBjString toString(Object object!)
Returns a string even for null objects. The DT.toString method eliminates the need to test for null() as null objects and objects without a toString() method are returned as an empty string.
declare BBjString xyz! xyz! = null() ?len(DT.toString(xyz!)) 0
v! = new BBjVector() ?DT.toString(v!) []
v!.add("abc")
v!.add("def")
v!.add("xyz")
?DT.toString(v!)
[abc, def, xyz]
Can be used to determine if an object is null or has non-blank value if object is null or empty:
if DT.toString(xyz!).isEmpty() then ...
if object is not null and not empty:
if ! DT.toString(xyz!).isEmpty() then ...
Can also be used to test for any non-blank characters in a string
if ! DT.toString(xyz!).trim().isEmpty() then print "Not null" else print "Null" fi
public static BBjString toString(BBjNumber value)Convert number to masked string with commas and decimal.
print DT.toString(1234567) 1, 234, 567 print DT.toString(1234.5678) 1, 234.5678 print DT.toString(0)
toString(BBjNumber value, boolean showZero!) currencyToString(BBjNumber value)public static BBjString toString(BBjNumber value, boolean showZero!)Convert number to masked string with commas and decimal and option to show 0.
print DT.toString(0, Boolean.TRUE) 0 print DT.toString(0, Boolean.FALSE)
print DT.toString(1234.5000, Boolean.FALSE) 1, 234.5 print DT.toString(0)
value - Number to be maskedshowZero! - true = show 0 as "0", false = show 0 as "". currencyToString(BBjNumber value)public static BBjTemplatedString toTemplatedString(Object string!, Object template!)
Return BBjTemplatedString given string and template.
call "CDS041", "CDS084", s084$, "YP" s084! = DT.toTemplatedString(s084$, fattr(s084$))
toTemplatedString(rec$)public static BBjTemplatedString toTemplatedString(BBjString rec$)
Return BBjTemplatedString from Templated String variable.
cm01! = DT.toTemplatedString(cm01$)
public static BBjTemplatedString toTemplatedString(DTJsonObject json!, BBjString tplkey$, BBjString reckey$)
Return BBjTemplatedString from json containing template and hta(data) as strings.
j! = new DTJsonObject()
j!.put("tpl", "id:n(4), name:c(30*=)")
j!.put("data", hta("1234United States"))
rec! = DT.toTemplatedString(j!, "tpl", "data")
?rec!.fattr()
?rec!.getFieldAsNumber("id")
?rec!.getFieldAsString("name")
ID:N(4), NAME:C(30*=)
1234
United States
public static BBjNumber toTimestamp(BBjNumber julDate, BBjNumber time)Convert julian date and time to linux timestamp in milliseconds.
?DT.toTimestamp(jul(0, 0, 0), tim) ?DT.toDateTimeString(1709877714222) 1709877714222 2024-03-08 01:01:54.222
julDate - BBj julian date.time - Time in hours and fractional hours.public static void traceOff()
Stops a trace started with DT.traceOn.
traceOn() traceOn(timed%)public static void traceOff(BBjInt action%)
Stops a trace and displays.
Must be run from Dynamo Tools Menu or BBj thinclient (not a terminal emulator).
action% - 0 = no display, 1 = display trace file in window, 2 = display in BBj Performance Analyzer.public static BBjInt traceOn()
Start untimed trace.
Traced BBj code will be saved in /u/CDI/tmp/DTTrace-NNN.txt.
traceOn(timed%) traceOff()public static BBjInt traceOn(BBjInt timed%)
Start a timed or untimed trace.
Traced BBj code will be saved in /u/CDI/tmp/DTTrace-NNN.txt. Timed trace files are used with the BBj Performance Analyzer tool to identify time-consuming code.
timed% - 0 = untimed, 1 = timed. traceOff()public static BBjString validateAddress(BBjTemplatedString rec!, BBjString pre$)
public static void writeLog()
Write log records stored using DT.log(BBjString).
Physically writes log entries created by DT.log(BBjString) to BBj Debug file.
public static void writeLog(BBjString text$)Log text and write log records stored using DT.log(BBjString).
Physically writes log entries created by DT.log(BBjString) to BBj Debug file. This method is called by DTServlet.bbj when responding to a servlet call. Can also be used to log text from a non-servlet application.
text$ - optional text to be appended to log.